package com.lagou.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lagou.dao.ArticleMapper;
import com.lagou.pojo.Article;
import com.lagou.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public PageInfo<Article> selectArticleList(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize,true);
        List<Article> articles = articleMapper.selectArticle();
        return new PageInfo<>(articles);
    }
}
